#import <UIKit/UIKit.h>
#import "ASIHTTPRequestDelegate.h"

typedef enum {
    WEIBO_POST_MESSAGE,
    WEIBO_UPLOAD
} RequestType;

@class OAConsumer,OAToken,OAuth,ShareClient;


@interface NSObject(ShareClient)
-(void)shareClientFinished:(ShareClient*)client;
@end

@interface ShareClient : NSObject<ASIHTTPRequestDelegate>
{
    BOOL        hasError;
    NSError    *_error;
    OAConsumer *_consumer;
    OAToken    *_accessToken;
    NSString   *_shareType;
    OAuth      *_oAuth;
    NSObject   *_responseObject;
    NSString   *_updatedScreenName;
    NSString   *_cachedStatus;
    NSObject   *_delegate;
}

@property(nonatomic, assign) BOOL hasError;
@property(nonatomic, retain) NSError *error;
@property(nonatomic, readonly) NSString *shareType;
@property(nonatomic, retain) NSString *screenName;
@property(nonatomic, retain) NSObject *responseObject;
@property(nonatomic, assign) NSObject *delegate;
@property(nonatomic, retain) NSString *cachedStatus;
@property(nonatomic, assign) RequestType requestType;

+ (ShareClient*)clientForType:(NSString*)type withConsumer:(OAConsumer *)oAConsumer 
andToken:(OAToken*)accessToken;
- (id)initWithConsumer:(OAConsumer *)oAConsumer andToken:(OAToken*)accessToken;
- (void)post:(NSString*)tweet;
- (void)upload:(NSData*)jpeg status:(NSString *)status;
@end

@interface SinaWeiboClient: ShareClient
@end

@interface NTESWeiboClient: ShareClient
@end

@interface QQWeiboClient: ShareClient
@end


